<script setup>
import { ref, onMounted } from 'vue';

const bannerlist = ref([]);

onMounted(async () => {
  const modules = import.meta.glob('@/assets/banner/*.png');
  for (const path in modules) {
    const mod = await modules[path]();
    bannerlist.value.push(mod.default);
  }
});

</script>



<template>
  <div class="home-banner">
    <el-carousel height="500px">
      <el-carousel-item v-for="(item,index) in bannerlist" :key="index">
        <img :src="item" alt="" style="object-fit: fill;">
      </el-carousel-item>
    </el-carousel>
  </div>
</template>



<style scoped lang='scss'>
.home-banner {
  width: 1240px;
  height: 500px;
  z-index: 98;

  img {
    width: 100%;
    height: 500px;
  }
}
</style>
